﻿Public Class RawDirectoryPicker
    Protected Overrides Function GetHandledMessageTypes() As List(Of Type)
        Return New List(Of Type)({GetType(Messages.Common.CloseWindow),
                                  GetType(Messages.Common.ShowSimpleMessage)})
    End Function

    Protected Overrides Sub HandleMessage(sender As KeyedViewModelBase, message As MessageBase)
        Select Case message.GetType
            Case GetType(Messages.Common.CloseWindow)
                Me.DialogResult = True
                message.Handled = True
            Case GetType(Messages.Common.ShowSimpleMessage)
                Dim m As Messages.Common.ShowSimpleMessage = CType(message, Messages.Common.ShowSimpleMessage)
                MessageBox.Show(m.Message, "", MessageBoxButton.OK)
        End Select
    End Sub

    Public ReadOnly Property ViewModel As RawDirectroyPickerVm
        Get
            Return CType(Me.DataContext, RawDirectroyPickerVm)
        End Get
    End Property
End Class
